﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Snake.Mapping;

namespace Snake.Cache
{
    /// <summary>
    /// 时间戳的key
    /// </summary>
    public class TimestampKey
    {
        public static String getTable(string typeFullName)
        {
            return "timestamp_table_" + typeFullName;
        }

        public static string getObject(EntityMap entityMap)
        {
            return "timestamp_object_" + entityMap.Table + "_" + entityMap.Key.Column.Value;
        }

        public static string getList(string sqlCacheKey)
        {
            return "timestamp_list_" + sqlCacheKey;
        }

        public static string getCount(Type t)
        {
            return "timestamp_count_" + t.FullName;
        }

        public static string getCount(Type t, String condition)
        {
            return "timestamp_count_" + t.FullName + "_" + condition;
        }
    }
}
